package com.example.mobile2030606162zwh0622;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;

public class MainActivity extends AppCompatActivity {

    private Button btnMainApi;
    private Button btnMain6days;
    private Button btnMainLaert;
    private Button btnMainCondition;
    private Button btnMainLimit;
    private TextView tvMainData;
    OkHttpClient okHttpClient=new OkHttpClient();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainCondition.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        RequestBody requestBody=new FormBody.Builder()
                                .add("cityId","917")
                                .add("token",MojiDataManager.CONDITIONTOKEN)
                                .build();

                    }
                }).start();
            }
        });
    }

    private void initView() {
        btnMainApi = (Button) findViewById(R.id.btnMainApi);
        btnMain6days = (Button) findViewById(R.id.btnMain6days);
        btnMainLaert = (Button) findViewById(R.id.btnMainLaert);
        btnMainCondition = (Button) findViewById(R.id.btnMainCondition);
        btnMainLimit = (Button) findViewById(R.id.btnMainLimit);
        tvMainData = (TextView) findViewById(R.id.tvMainData);
    }
}